package org.example.order.controller;

import lombok.Getter;

@Getter
public class Result {
    private boolean success;
    private String message;
    private Object data;

    private Result() {
    }

    private Result(Object data) {
        this.data = data;
    }

    private Result(String message) {
        this.message = message;
    }

    public static Result fail(String message) {
        Result result = new Result(message);
        result.success = false;
        return result;
    }

    public static Result success(Object data) {
        Result result = new Result(data);
        result.success = true;
        return result;
    }

    public static Result success() {
        Result result = new Result();
        result.success = true;
        return result;
    }
}
